package com.vanzo.bean;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.vanzo.bean.Channel;
import com.vanzo.bean.Contact;
import com.vanzo.bean.Follower;

import com.vanzo.bean.ChannelDao;
import com.vanzo.bean.ContactDao;
import com.vanzo.bean.FollowerDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig channelDaoConfig;
    private final DaoConfig contactDaoConfig;
    private final DaoConfig followerDaoConfig;

    private final ChannelDao channelDao;
    private final ContactDao contactDao;
    private final FollowerDao followerDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        channelDaoConfig = daoConfigMap.get(ChannelDao.class).clone();
        channelDaoConfig.initIdentityScope(type);

        contactDaoConfig = daoConfigMap.get(ContactDao.class).clone();
        contactDaoConfig.initIdentityScope(type);

        followerDaoConfig = daoConfigMap.get(FollowerDao.class).clone();
        followerDaoConfig.initIdentityScope(type);

        channelDao = new ChannelDao(channelDaoConfig, this);
        contactDao = new ContactDao(contactDaoConfig, this);
        followerDao = new FollowerDao(followerDaoConfig, this);

        registerDao(Channel.class, channelDao);
        registerDao(Contact.class, contactDao);
        registerDao(Follower.class, followerDao);
    }
    
    public void clear() {
        channelDaoConfig.clearIdentityScope();
        contactDaoConfig.clearIdentityScope();
        followerDaoConfig.clearIdentityScope();
    }

    public ChannelDao getChannelDao() {
        return channelDao;
    }

    public ContactDao getContactDao() {
        return contactDao;
    }

    public FollowerDao getFollowerDao() {
        return followerDao;
    }

}
